﻿// HSS.Logging.Management.LogItemViewer.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       LogItemViewer.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
namespace HSS.Logging.Management
{
	internal partial class LogItemViewer : HSS.Forms.Docking.DockContent
	{
		public LogItemViewer()
		{
			InitializeComponent();
		}

		/// <summary>
		/// Display to detail of a Log Item
		/// </summary>
		/// <param name="entry">A LogEntry</param>
		public void DisplayItemDetail(LogEntry entry)
		{
			if (null == entry)
			{
				this.txtMessage.ResetText();
				this.MsgId.ResetText();
				this.MsgType.ResetText();
				this.MsgCategory.ResetText();
				this.MsgRefNum.ResetText();
				this.MsgUser.ResetText();
				this.MsgDate.ResetText();
				return;
			}

			this.txtMessage.Text = entry.Message;
			this.MsgId.Text = entry.EventId.ToString();
			this.MsgType.Text = entry.EventType.ToString();
			this.MsgCategory.Text = entry.Category;
			this.MsgRefNum.Text = entry.ReferenceNumber;
			this.MsgUser.Text = entry.User;
			this.MsgDate.Text = entry.CreatedDate.ToString();
		}

	}
}